//
//  IMUserManager.h
//  MLIM
//
//  Created by molon on 15/7/5.
//  Copyright (c) 2015年 molon. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "IMConstants.h"

extern NSString * const MLIM_IMUser_UpdateOrAddUsers_Notification;

#define IMUM ([IMUserManager manager])
@interface IMUserManager : NSObject

//根据clientIds搜索users
@property (nonatomic, copy) void(^imUsersSearchBlock)(NSSet *clientIdsSet,IMDictionaryResultBlock callback);

@property (nonatomic, copy) void(^didTappedAvatarBlock)(IMUser *user,IMConversationViewController *convVC);

@property (nonatomic, copy) NSString *(^defaultNameWithClientIdBlock)(NSString *clientId);

+ (instancetype)manager;

//根据clientIds获取imUsers，这个方法不会更新内存缓存，缓存有就从里面取，没的话从网络取
- (void)imUsersWithClientIds:(NSSet*)clientIdsSet callback:(IMDictionaryResultBlock)callback;

//根据clientId获取imUser，这个方法不会更新内存缓存，缓存有就从里面取，没的话从网络取
- (void)imUserWithClientId:(NSString*)clientId callback:(IMUserResultBlock)callback;

//主动更新或者添加imUser, 这个方法会更新内存缓存
- (void)updateOrAddClientIds:(NSSet*)clientIdsSet callback:(IMBooleanResultBlock)callback;

@end
